package com.shioirikukuri.mapper;

import com.shioirikukuri.entity.SetmealFood;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealFoodMapper {
	@Insert("INSERT INTO setmeal_foods(setmeal_id, food_id) VALUES(#{setmealId}, #{foodId})")
	void insert(SetmealFood setmealFood);

	@Delete("DELETE FROM setmeal_foods WHERE setmeal_id=#{setmealId}")
	void deleteBySetmealId(Long setmealId);

	@Select("SELECT food_id FROM setmeal_foods WHERE setmeal_id=#{setmealId}")
	List<Long> findFoodIdsBySetmealId(Long setmealId);
}
